package com.itbaizhan.exceptionhandler;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class GlobleHandler {
    @ExceptionHandler(Exception.class)
    public String handle(Exception ex, Model model){
        model.addAttribute("msg", ex);
        return "error2";
    }
}
